<?php
$sbOld = "";
$sbOld = $sbOld . $requestId;
$sbOld = $sbOld . $tradeProcess;
$sbOld = $sbOld . $totalBizType;
$sbOld = $sbOld . $totalPrice;
$sbOld = $sbOld . $backurl;
$sbOld = $sbOld . $returnurl;
$sbOld = $sbOld . $noticeurl;
$sbOld = $sbOld . $description;
$signatrue = HmacMd5($sbOld, $merKey);

function HmacMd5($data, $key) {
        // RFC 2104 HMAC implementation for php.
        // Creates an md5 HMAC.
        // Eliminates the need to install mhash to compute a HMAC
        // Hacked by Lance Rushing(NOTE: Hacked means written)

        //需要配置环境支持iconv，否则中文参数不能正常处理
        $key = iconv("GB2312", "UTF-8", $key);
        $data = iconv("GB2312", "UTF-8", $data);

        $b = 64; // byte length for md5
        if (strlen($key) > $b) {
                $key = pack("H*", md5($key));
        }
        $key = str_pad($key, $b, chr(0x00));
        $ipad = str_pad('', $b, chr(0x36));
        $opad = str_pad('', $b, chr(0x5c));
        $k_ipad = $key ^ $ipad;
        $k_opad = $key ^ $opad;

        return md5($k_opad . pack("H*", md5($k_ipad . $data)));
}
?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Okydt To sumapay Page</title>
</head>
<body onload="document.sumapay.submit()">
        <form name="sumapay" action="<?php echo $payUrl; ?>" method="post" target="_blank">
                <input type="hidden" name="requestId" value="<?php echo $requestId; ?>">
                <input type="hidden" name="tradeProcess" value="<?php echo $tradeProcess; ?>">
                <input type="hidden" name="mersignature" value="<?php echo $signatrue; ?>">
                <input type="hidden" name="totalBizType" value="<?php echo $totalBizType; ?>">
                <input type="hidden" name="totalPrice" value="<?php echo $totalPrice; ?>">
                
                <input type="hidden" name="backurl" value="<?php echo $backurl; ?>">
                <input type="hidden" name="returnurl" value="<?php echo $returnurl; ?>">
                <input type="hidden" name="noticeurl" value="<?php echo $noticeurl; ?>">
                <input type="hidden" name="description" value="<?php echo $description; ?>">
                <!--
                <input type="hidden" name="bankcode" value="<?php echo $bankcode; ?>">
                <input type="hidden" name="rnaName" value="<?php echo $rnaName; ?>">
                <input type="hidden" name="rnaIdNumber" value="<?php echo $rnaIdNumber; ?>">
                <input type="hidden" name="rnaMobilePhone"value="<?php echo $rnaMobilePhone; ?>">
                <input type="hidden" name="goodsDesc" value="<?php echo $goodsDesc; ?>">
                <input type="hidden" name="userIdIdentity" value="<?php echo $userIdIdentity; ?>">
                <input type="hidden" name="payType" value="<?php echo $payType; ?>">
                <input type="hidden" name="allowRePay" value="<?php echo $allowRePay; ?>">
                <input type="hidden" name="rePayTimeOut" value="<?php echo $rePayTimeOut; ?>">
                <input type="hidden" name="bankCardType" value="<?php echo $bankCardType; ?>">
                -->
                <input type="hidden" name="productId" value="<?php echo $productId; ?>">
                <input type="hidden" name="productName" value="<?php echo $productName; ?>">
                <input type="hidden" name="fund" value="<?php echo $fund; ?>">
                <input type="hidden" name="bizType" value="<?php echo $bizType; ?>">
                <input type="hidden" name="merAcct" value="<?php echo $merAcct; ?>">
                <input type="hidden" name="productNumber" value="<?php echo $productNumber; ?>">                
        </form>
</body>
</html>